import request from '@/utils/request'

/**
 * 获取组织架构
 */
export const getDepartment = () => {
  return request.get('/company/department')
}

/**
 * 获取部门负责人
 */

export const getManagerList = () => {
  return request({
    url: '/sys/user/simple'
  })
}
/**
 * 新增组织
 */

export const addDepartment = (data) => {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
 * 获取部门详情
 */
export const getDepartmentDetail = (id) => {
  return request({
    url: `/company/department/${id}`
  })
}

/**
 * 更新部门详情
 */
export const updateDepartment = (data) => {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}

export const delDepartment = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
